package BehaviorDesignPattern.IteratorPattern;

import BehaviorDesignPattern.IteratorPattern.interfase.Aggregate;
import BehaviorDesignPattern.IteratorPattern.interfase.Iterator;

import java.util.ArrayList;
import java.util.List;

public class ConcreteAggregate implements Aggregate {
    private List<Object> list = new ArrayList<>();

    void add(Object o){
        list.add(o);
    }

    @Override
    public Iterator createIterator() {
        return new ConcreteIterator(list);
    }
}
